package com.xielx.mynovel.slice;

import com.xielx.mynovel.ResourceTable;
import ohos.aafwk.ability.AbilitySlice;
import ohos.aafwk.content.Intent;
import ohos.agp.components.Button;

public class ConfirmSlice extends AbilitySlice {

    @Override
    protected void onStart(Intent intent) {
        super.onStart(intent);
        setUIContent(ResourceTable.Layout_proxy_confirm);
        Button yes = (Button) findComponentById(ResourceTable.Id_config_yes);
        Button no = (Button) findComponentById(ResourceTable.Id_config_no);
        yes.setClickedListener(component -> {
            intent.setParam("proxy","yes");
            setResult(intent);
            //返回上一页
            terminate();
        });
        no.setClickedListener(component -> {
            intent.setParam("proxy","no");
            setResult(intent);
            //返回上一页
            terminate();
        });
    }
}
